/******************** 变量 ********************/
$treeselect-icon-color: #808080;
$treeselect-trigger-item-bg-color: #f2f2f2;

/******************** mixin ********************/

/******************** 组件 ********************/
.lv-tree-select {
  display: inline-block;
  width: 100%;
  color: $text-color;
  font-size: $font-size-base;
  font-family: $font-family;
  line-height: $line-height-base;
  vertical-align: middle;
  cursor: pointer;

  &.disabled {
    cursor: not-allowed;
  }
}

.lv-treeselect-container {
  width: 100%;
  min-width: 1rem;
  margin: $margin-xs 0;
  border-radius: $border-radius-md;
  background: $component-background;
  box-shadow: $shadow-sm;

  .notree {
    height: 0; // 解决tree搜出来没有数据时占据高度问题
  }
  .cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper {
    width: 100%;
  }
  .lv-treenode-main {
    overflow: hidden;
  }
}
.lv-treeselect-panel-content {
  max-height: 2.88rem;
  padding: 0 0 0 $padding-sm;

  @include component-scroll;

  .lv-tree-virtual-scroll {
    @include component-scroll;
  }

  &:not(.treeselect-virtualscroll-container) {
    overflow: auto;
  }
  .lv-tree {
    display: block;
  }
}
.lv-treeselect-z-index {
  z-index: $zindex-tree-select;
}
// search
.lv-treeselect-panel-search {
  padding: $margin-sm;
  .lv-search {
    width: 100%;
    overflow: hidden;
  }
}

.lv-treeselect-trigger {
  // 自定义样式: 展示区 头 底
  overflow: hidden;
}

.lv-treeselect-selection-null {
  @include panel-dropdown-empty-style;
}

.lv-select-trigger-scroll {
  width: 100%;
  height: 0.92rem;
}

.lv-treeselect-header,
.lv-treeselect-footer {
  display: block;
}

// 表单控件错误样式
.lv-form-control-has-error .lv-tree-select.ng-invalid.ng-dirty,
.lv-form-control-has-error .lv-tree-select.ng-invalid.ng-touched {
  .lv-treeselect-wrapper {
    border-color: $error-color;
  }
}
